package xutil

import (
	"strconv"
	"strings"
)

func F判断身份证号是否异常(sfz string) bool {
	if len(sfz) != 18 {
		return false
	}
	strArr1 := strings.Split(sfz, "")
	xy := strings.Split("1,0,X,9,8,7,6,5,4,3,2", ",")
	strArr3 := strings.Split("7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2", ",")
	n := 0
	for k, v := range strArr3 {
		n += num(strArr1[k]) * num(v)
	}
	return xy[n%11] == strArr1[17]
}

func num(s string) (n int) {
	n, _ = strconv.Atoi(s)
	return
}
